1. Field of the Invention
The present invention relates to signal processing, and, more specifically but not exclusively, to techniques for encoding and decoding data.
2. Description of the Related Art
Some conventional hard-disk drive (HDD) systems employ encoding, such as low-density parity-check (LDPC) encoding, to generate data for storage on their hard-disk platters. One conventional LDPC encoder receives 4,512-bit datawords and generates 5,184-bit codewords having the 4,512 user-data bits and 672 parity bits.
In HDD systems, the number of bits per platter sector may vary from one manufacturer to the next or from one manufacturer's model to the next. For example, a “0.5 KB” sector may have as few as 4,096 bits or as many as 5,184 bits. One manufacturer might design an HDD system having “0.5 KB” sectors that store 5,184 bits, while another manufacturer might design a different HDD system having “0.5 KB” sectors that store 4,116 bits. To accommodate such variations in sector sizes, different encoders and decoders could be implemented for each HDD system based on the number of bits stored in the sectors of the HDD system. However, manufacturing different encoders and decoders for every different possible sector size can be time consuming and expensive.
Rather than design different encoders and different decoders to support different sector sizes, a single configurable HDD system may be implemented that can be configured to accommodate different sector sizes. In such implementations, the encoder is designed to generate codewords having a fixed number of bits. When the encoder is used to generate sets of data (referred to herein as “transmission words”) for storage on a hard-disk platter whose sectors are smaller than that fixed codeword size, sufficiently small sets of user-data bits are used to generate each codeword. In particular, a sufficient number of padding bits are added to each set of user-data bits to generate a full dataword for application to the encoder, and the padding bits are discarded from the resulting codeword to generate a transmission word that is sized appropriately for storage to the hard-disk platter. This technique is sometimes referred to as “code shortening.”
In such implementations, the number of user-data bits encoded and the number of padding bits added varies depending on the sector size. Further, the padding bits are set to values (e.g., all zeros or all ones) and at locations that are known a priori by the receiver side of the HDD system. Upon receiving the transmission word from the HDD platter, the receiver inserts appropriate padding bits to reconstruct the codeword. Then, the codeword is decoded to recover the dataword, and the padding bits are removed to recover the original user-data stream.